package com.haipumi.dao.impl;

import java.sql.SQLException;
import java.util.List;

import com.haipumi.beans.haipumi_helpInfo;
import com.haipumi.dao.DBHelper;
import com.haipumi.dao.IBackHelpInfoDao;

public class BackHelpeInfoDaoImpl implements IBackHelpInfoDao {
	
	DBHelper db=new DBHelper();
	@Override
	public List<haipumi_helpInfo> findAllHelpInfo() {
		String sql="select * from haipumi_helpinfo ";
		List<haipumi_helpInfo>helpinfolist=null;
		try {
			helpinfolist=db.finds(sql, null, haipumi_helpInfo.class);
			
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		return helpinfolist;
	}

	@Override
	public int countAllHelpeInfo() {
		String sql="select count(*) from haipumi_helpinfo ";
		int r=0;
		try {
			r=(int) db.findDouble(sql, null);
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return r;
	}

}
